<?php
/**
 * @author 刘国君
 * @version 1.0
 */

$ml="INVITE sip:34020000001310000001@192.168.1.92:9300 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.1.80:9301;rport;branch=z9hG4bK14273066\r\nFrom: <sip:34020000002000000001@192.168.1.80:9301>;tag=539567811\r\nTo: <sip:34020000001310000001@192.168.1.92:9300>\r\nCall-ID: 842999597\r\nCSeq: 1 Invite\r\nContent-Type: APPLICATION/SDP\r\nMax-Forwards: 70\r\nUser-Agent: eXosip/3.6.0\r\nContact:<sip:34020000002000000001@192.168.1.80:9301>\r\nSubject:34020000001310000001:015359105,34020000002000000001:015369105\r\nContent-Length: 240\r\n\r\nv=0\r\no=34020000002000000001 0 0 IN IP4 192.168.1.80\r\ns=Play\r\nc=IN IP4 192.168.1.80\r\nt=0 0\r\nm=video 6036 RTP/AVP 96 98 97\r\na=recvonly\r\na=rtpmap:96 PS/90000\r\na=rtpmap:98 H264/90000\r\na=rtpmap:97 MPEG4/90000\r\ny=0100000001\r\nf=";

$fp=stream_socket_client('udp://127.0.0.1:9301',$errno, $errstr);
if (!$fp) {
    echo "ERROR: $errno - $errstr<br />\n";
} else {
    fwrite($fp,$ml);
    echo fread($fp,1024);
}
